{% extends "base.html" %}

{% block content %}
<div class="row">
    <div class="col-md-6 mb-4">
        <div class="card">
            <div class="card-header">
                <h5 class="mb-0">男女选手比例</h5>
            </div>
            <div class="card-body">
                <div class="row">
                    <div class="col-md-6">
                        <div class="stat-card">
                            <div class="stat-number">{{ gender_stats.get('M', 0) }}</div>
                            <div class="stat-label">男性选手</div>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="stat-card">
                            <div class="stat-number">{{ gender_stats.get('F', 0) }}</div>
                            <div class="stat-label">女性选手</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="col-md-6 mb-4">
        <div class="card">
            <div class="card-header">
                <h5 class="mb-0">男女完赛时间分布</h5>
            </div>
            <div class="card-body">
                <div id="genderBox"></div>
            </div>
        </div>
    </div>
</div>

<script>
    var genderBoxData = {{ gender_box | safe }};
    Plotly.newPlot('genderBox', genderBoxData.data, genderBoxData.layout);
</script>
{% endblock %} 